package cn.corpnet.personal.rui.learning.java8;

import org.apache.commons.lang3.ArrayUtils;

import java.util.Arrays;
import java.util.Comparator;

public class LambdaExample {

    public void testLambda() {
        Comparator<String> comp = Comparator.comparingInt(String::length);

        String[] words = new String[]{"a","bcccc","ab","abc"};
        Arrays.sort(words,comp);

        System.out.println(ArrayUtils.toString(words));

    }

    public static void main(String[] args) {
        new LambdaExample().testLambda();
    }
}
